﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace School.WebPages.Ad
{
    public partial class AdDetails : System.Web.UI.Page
    {
        TechnologySchoolEntities db = new TechnologySchoolEntities();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                BindData();
            }
        }

        private void BindData()
        {
            int aid = int.Parse(Request.QueryString["aid"]);
            var ad = db.Ad.FirstOrDefault(a => a.Aid == aid);
            ltContent.Text = ad.Content;
        }
    }
}
